package com.dream.inspect.modules.business.controller;

import com.dream.inspect.modules.business.service.HomeStatisticsService;
import com.dream.inspect.modules.sys.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 首页统计图
 */
@RestController
@CrossOrigin
@RequestMapping("business/homeStatistics")
public class HomeStatisticsController extends AbstractController {
    @Autowired
    private HomeStatisticsService homeStatisticsService;
    /**
     * 问题统计 趋势 折线图
     * @param params
     * @return
     */
    @RequestMapping("trendsView")
    public List<Map<String, Object>> trendsView(@RequestBody Map<String, Object> params){

        return homeStatisticsService.trendsView(params);
    }
    /**
     * 问题统计 环形图
     * @param params
     * @return
     */
    @RequestMapping("problemChartAnnular")
    public List<Map<String, Object>> problemChartAnnular(@RequestBody Map<String, Object> params){

        return homeStatisticsService.problemChartAnnular(params);
    }
    /**
     * 整改问题统计 半环形图
     * @param params
     * @return
     */
    @RequestMapping("rectifyChartSemiRing")
    public List<Map<String, Object>> rectifyChartSemiRing(@RequestBody Map<String, Object> params){

        return homeStatisticsService.rectifyChartSemiRing(params);
    }
    /**
     * 整改单位统计 本年
     * @param params
     * @return
     */
    @RequestMapping("yearDeptQuestionCount")
    public List<Map<String, Object>> yearDeptQuestionCount(@RequestBody Map<String, Object> params){

        return homeStatisticsService.yearDeptQuestionCount(params);
    }

}
